Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for migrating to glfw3.0.4 for the sb6 classes #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prabindh
Copy link

The attached patch for sb6.h migrates sb6 classes to use glfw3.0.4 package. Build tested with Visual Studio 2012 on Windows 7, with glfw3.0.4 and sb6code.

@sajis997
Copy link

I could not manage to compile your fork on linux with glfw3

Did you try ?

@prabindh
Copy link
Author

Sorry, I tried on Windows, but it should be quick enough for me to try on Linux. Any chance you can share the error log ?

regards
Prabindh

On Thursday, March 27, 2014 7:37 PM, sajis997 [email protected] wrote:

I could not manage to compile your fork on linux with glfw3
Did you try ?

Reply to this email directly or view it on GitHub.

@sajis997
Copy link

Here goes the error info 1:

/////////////////////////////////////////////
[ 1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
In file included from /home/sajjad/Downloads/OpenGL/SuperBible/prabindh/sb6code-master/src/sb6/sb6.cpp:26:0:
/home/sajjad/Downloads/OpenGL/SuperBible/prabindh/sb6code-master/include/sb6.h: In static member function ‘static void sb6::application::glfw_onMouseWheel(GLFWwindow_, double, double)’:
/home/sajjad/Downloads/OpenGL/SuperBible/prabindh/sb6code-master/include/sb6.h:314:37: error: no matching function for call to ‘sb6::application::onMouseWheel(double&, double&)’
/home/sajjad/Downloads/OpenGL/SuperBible/prabindh/sb6code-master/include/sb6.h:314:37: note: candidate is:
/home/sajjad/Downloads/OpenGL/SuperBible/prabindh/sb6code-master/include/sb6.h:241:18: note: virtual void sb6::application::onMouseWheel(int)
/home/sajjad/Downloads/OpenGL/SuperBible/prabindh/sb6code-master/include/sb6.h:241:18: note: candidate expects 1 argument, 2 provided
make[2]: *_* [CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o] Error 1
make[1]: *** [CMakeFiles/sb6.dir/all] Error 2
make: *** [all] Error 2
//////////////////////////////////////////////////////////////////////

@prabindh
Copy link
Author

Sorry. It is an issue with the Windows build as well. My patch generation process is broken at the moment, but I made a commit to fix this - can you please try this on top of what you have: prabindh@ed8b584

@sajis997
Copy link

Thanks for the effort, now i got something i used to get initially , linker error:

//////////////////////////////////////////
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function sb6::application::run(sb6::application*)': alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application*)]+0x14): undefined reference toglfwInit'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x72): undefined reference to glfwWindowHint' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x8b): undefined reference to glfwWindowHint'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application*)]+0x9f): undefined reference toglfwWindowHint' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0xb3): undefined reference to glfwWindowHint'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0xcc): undefined reference to glfwWindowHint' CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application*)]+0xf9): more undefined references toglfwWindowHint' follow
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function sb6::application::run(sb6::application*)': alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application*)]+0x12d): undefined reference toglfwGetPrimaryMonitor'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x135): undefined reference to glfwGetVideoMode' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x15a): undefined reference to glfwGetPrimaryMonitor'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application*)]+0x18e): undefined reference toglfwCreateWindow' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x1d0): undefined reference to glfwTerminate'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x1ef): undefined reference to glfwSwapInterval' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application*)]+0x227): undefined reference toglfwCreateWindow'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x269): undefined reference to glfwTerminate' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x27f): undefined reference to glfwMakeContextCurrent'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application*)]+0x29a): undefined reference toglfwSetWindowTitle' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x2b3): undefined reference to glfwSetWindowSizeCallback'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x2cc): undefined reference to glfwSetKeyCallback' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application*)]+0x2e5): undefined reference toglfwSetMouseButtonCallback'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x2fe): undefined reference to glfwSetScrollCallback' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x330): undefined reference to glfwSetInputMode'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application*)]+0x353): undefined reference toglfwSetInputMode' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x36c): undefined reference to glfwGetWindowAttrib'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x44e): undefined reference to glfwGetTime' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application*)]+0x46b): undefined reference toglfwSwapBuffers'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application_)]+0x470): undefined reference to glfwPollEvents' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x48d): undefined reference to glfwGetKey'
alienrain.cpp:(.text.ZN3sb611application3runEPS0[sb6::application::run(sb6::application*)]+0x4b0): undefined reference toglfwWindowShouldClose' alienrain.cpp:(.text._ZN3sb611application3runEPS0_[sb6::application::run(sb6::application_)]+0x4e5): undefined reference to glfwTerminate'
lib/libsb6.a(gl3w.c.o): In functionopen_libgl': gl3w.c:(.text+0x16): undefined reference to dlopen'
lib/libsb6.a(gl3w.c.o): In functionclose_libgl': gl3w.c:(.text+0x30): undefined reference to dlclose'
lib/libsb6.a(gl3w.c.o): In functionget_proc': gl3w.c:(.text+0x43): undefined reference to glXGetProcAddress'
gl3w.c:(.text+0x60): undefined reference to`dlsym'
collect2: ld returned 1 exit status
make[2]: *_* [bin/alienrain] Error 1
make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2
make: *** [all] Error 2
/////////////////////////////////////////////////////////////

I think some changes is necessary inside the CMakeLists.txt.

I already have the new version of glfw installed and do we need to refer to it as external library inside the CMakeList.txt ?

Thanks

@johnallsup
Copy link

In CMakeLists.txt we have

if(WIN32)
set(COMMON_LIBS sb6 optimized GLFW_r32 debug GLFW_d32)
elif(UNIX)
set(COMMON_LIBS sb6 glfw ${GLFW_LIBRARIES} GL rt dl)
else()
set(COMMON_LIBS sb6)
endif()

The trouble is that the elif(UNIX) bit works out as false on my Linux box. If I replace
else()
set(COMMON_LIBS sb6)
with
else()
set(COMMON_LIBS sb6 glfw ${GLFW_LIBRARIES} GL rt dl)

then it builds ok.

@johnallsup
Copy link

Having said it builds ok, the programs fail to create an OpenGL context.

@prabindh
Copy link
Author

What toolchain are you using to build ? CMake should detect all *nix flavors correctly. http://www.cmake.org/Wiki/CMake_Useful_Variables#System_.26_Compiler_Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants